﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) Michael Herndon.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.Twitter
{
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.ServiceModel;
	using System.ServiceModel.Web;
	using System.Text;


	/// <summary>
	/// Contract for twitter Friendship methods. 
	/// </summary>
	[ServiceContract]
	public interface IFriendshipClient
	{
		/// <summary>
		/// Creates a friendship with the current user and the user specified.
		/// </summary>
		/// <param name="id">The screen name or user id.</param>
		/// <returns>returns a <see cref="Amplify.Twitter.User"/> object. </returns>
		/// <exception cref="System.ServiceModel.Security.MessageSecurityException" />
		/// <exception cref="Amplify.Twitter.TwitterException"> Throws when a twitter error occurs. </exception>
		[OperationContract,
			WebInvoke(
				BodyStyle = WebMessageBodyStyle.Bare,
				ResponseFormat = WebMessageFormat.Json,
				UriTemplate = "/friendships/create/{id}.json")]
		User Create(string id);

		/// <summary>
		/// Destroys a friendship with the current user and the user specified.
		/// </summary>
		/// <param name="id">The screen name or user id.</param>
		/// <returns>returns a <see cref="Amplify.Twitter.User"/> object.</returns>
		/// <exception cref="System.ServiceModel.Security.MessageSecurityException" />
		[OperationContract,
			WebInvoke(
				BodyStyle = WebMessageBodyStyle.Bare,
				ResponseFormat = WebMessageFormat.Json,
				UriTemplate = "/friendships/destroy/{id}.json")]
		User Destroy(string id);

		/// <summary>
		/// Determines if their is a friendship between two users.
		/// </summary>
		/// <param name="userId1">The screen name or user id of the first user.</param>
		/// <param name="userId2">The screen name or user id of the second user.</param>
		/// <returns>returns a <see cref="Amplify.Twitter.ExistResponse"/> object.</returns>
		/// <exception cref="System.ServiceModel.Security.MessageSecurityException" />
		[OperationContract,
			WebInvoke(
				BodyStyle = WebMessageBodyStyle.Bare,
				ResponseFormat = WebMessageFormat.Xml,
				UriTemplate = "/friendships/exists.xml?user_a={userId1}&user_b={userId2}")] //json url currently does not work <^>
		ExistResponse DetermineIfExists(string userId1, string userId2);
	}
}
